package com.sd.activity;

import com.sd.util.PreferencesManager;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import cn.w.song.widget.scroll.SlidePageView;
import cn.w.song.widget.scroll.SlidePageView.OnPageViewChangedListener;

/**
 * 
 * 
 * @author Alex.Lu
 * 
 */
public class GuideActivity extends BaseActivity implements OnClickListener {

	private Button mStart;
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_guide);
		
		SlidePageView spv = (SlidePageView) findViewById(R.id.slidepageviewtest_ui_SlidePageView_test);
		//spv.setCurrPagePosition(0);//设置当前页位置
		spv.setOnPageViewChangedListener(new OnPageViewChangedListener() {

			@Override
			public void OnPageViewChanged(int currPagePosition,
					View currPageView) {
			}
		});
		mStart = (Button)findViewById(R.id.start);
		mStart.setVisibility(View.VISIBLE);
		mStart.setOnClickListener(this);
		/*if(PreferencesManager.getInstance().getISFirst()){
			mStart = (Button)findViewById(R.id.start);
			mStart.setVisibility(View.VISIBLE);
			mStart.setOnClickListener(this);
		}*/
		
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		int v_id = v.getId();
		
		switch (v_id) {
		case R.id.start:
			if(PreferencesManager.getInstance().getISFirst()){
				PreferencesManager.getInstance().setISFirst(false);
				Intent intent = new Intent();
				intent.setClass(this, MainTabActivity.class);
				startActivity(intent);
			}
			finish();
			break;

		default:
			break;
		}
	}



}